﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Admin_User.aspx.cs" Inherits="Admin_User" %>

<%@ Register Assembly="XControl" Namespace="XControl" TagPrefix="XCL" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:Panel ID="Panel1" runat="server" Style="clear: both; float: left">
                <asp:Label ID="lb_UserInfor" runat="server" Text="查找内容："></asp:Label><asp:TextBox
                    ID="txt_UserInfor" runat="server"></asp:TextBox><asp:Button ID="btn_FindUser" runat="server"
                        Text="查找" />
                <XCL:XGridView ID="XGridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                    DataKeyNames="ID" DataSourceID="ObjectDataSource1" AllowSorting="True"><Columns><asp:TemplateField HeaderText="用户名" SortExpression="UserName"><edititemtemplate><asp:TextBox runat="server" Text='<%# Bind("UserName") %>' id="TextBox1"></asp:TextBox></edititemtemplate><itemtemplate>&#160;<asp:LinkButton id="LinkButton2" runat="server" Text='<%# Eval("UserName") %>' CommandName="Select" CausesValidation="False" __designer:wfdid="w5"></asp:LinkButton></itemtemplate><headerstyle cssclass="TextHead" /><itemstyle cssclass="TextItem" /></asp:TemplateField><asp:BoundField DataField="Logins" HeaderText="登录" SortExpression="Logins"><headerstyle cssclass="IntHead" /><itemstyle cssclass="IntItem" /></asp:BoundField><asp:BoundField DataField="LastLoginIP" HeaderText="地址" SortExpression="LastLoginIP"><headerstyle cssclass="TextHead" /><itemstyle cssclass="TextItem" /></asp:BoundField><asp:BoundField DataField="LastLoginTime" HeaderText="时间" SortExpression="LastLoginTime"><headerstyle cssclass="DateHead" /><itemstyle cssclass="DateItem" /></asp:BoundField><asp:CommandField ShowDeleteButton="True" /></Columns></XCL:XGridView>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DataObjectTypeName="XCMSData.User"
                    DeleteMethod="Delete" OldValuesParameterFormatString="original_{0}" SelectMethod="Search"
                    TypeName="XCMSData.User" SelectCountMethod="SearchCount" 
                    EnablePaging="True" SortParameterName="__order">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="txt_UserInfor" Name="condition" PropertyName="Text"
                            Type="String" />
                        <asp:Parameter Name="__order" Type="String" />
                        <asp:Parameter DefaultValue="0" Name="startRowIndex" Type="Int32" />
                        <asp:Parameter DefaultValue="2147483647" Name="maximumRows" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </asp:Panel>
        </div>
        <div style="clear: both; float: left">
            <XCL:XFormView ID="XFormView1" runat="server" DataKeyNames="ID" DataSourceID="ObjectDataSource2"
                AutoRefreshXGridView="True">
                <edititemtemplate>
					<div id="XFormView1_Edit" class="XFormView">
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									编号：</div>
								<div class="ItemValue">
									<asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									用户名：</div>
								<div class="ItemValue">
									<asp:TextBox ID="UserNameTextBox" runat="server" 
										Text='<%# Bind("UserName") %>' />
								</div>
							</div>
							<div class="Item">
								<div class="ItemName">
									密码：</div>
								<div class="ItemValue">
									<asp:TextBox ID="PassWordTextBox" runat="server" Text='<%# Bind("PassWord") %>' 
										TextMode="Password" />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									登录：</div>
								<div class="ItemValue">
									<XCL:NumberBox ID="LoginsNumberBox" runat="server" 
										Text='<%# Bind("Logins") %>' />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									地址：</div>
								<div class="ItemValue">
									<asp:TextBox ID="LastLoginIPTextBox" runat="server" 
										Text='<%# Bind("LastLoginIP") %>' />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									时间：</div>
								<div class="ItemValue">
									<XCL:DateBox ID="LastLoginTimeDateBox" runat="server" 
										Text='<%# Bind("LastLoginTime", "{0:yyyy-MM-dd HH:mm:ss}") %>' />
								</div>
							</div>
						</div>
						<div class="Foot">
							<div style="float: left">
								<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="true" 
									CommandName="Update" Text="更新" />
							</div>
							<div style="width:5px; float:left">
							</div>
							<div style="float: left">
								<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="false" 
									CommandName="Cancel" Text="取消" />
							</div>
						</div>
					</div>
				</edititemtemplate>
				<insertitemtemplate>
					<div id="XFormView1_Inst" class="XFormView">
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									用户名：</div>
								<div class="ItemValue">
									<asp:TextBox ID="UserNameTextBox" runat="server" 
										Text='<%# Bind("UserName") %>' />
								</div>
							</div>
							<div class="Item">
								<div class="ItemName">
									密码：</div>
								<div class="ItemValue">
									<asp:TextBox ID="PassWordTextBox" runat="server" Text='<%# Bind("PassWord") %>' 
										TextMode="Password" />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									登录：</div>
								<div class="ItemValue">
									<XCL:NumberBox ID="LoginsNumberBox" runat="server" 
										Text='<%# Bind("Logins") %>' />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									地址：</div>
								<div class="ItemValue">
									<asp:TextBox ID="LastLoginIPTextBox" runat="server" 
										Text='<%# Bind("LastLoginIP") %>' />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									时间：</div>
								<div class="ItemValue">
									<XCL:DateBox ID="LastLoginTimeDateBox" runat="server" 
										Text='<%# Bind("LastLoginTime", "{0:yyyy-MM-dd HH:mm:ss}") %>' />
								</div>
							</div>
						</div>
						<div class="Foot">
							<div style="float: left">
								<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="true" 
									CommandName="Insert" Text="插入" />
							</div>
							<div style="width:5px; float:left">
							</div>
							<div style="float: left">
								<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="false" 
									CommandName="Cancel" Text="取消" />
							</div>
						</div>
					</div>
				</insertitemtemplate>
				<itemtemplate>
					<div id="XFormView1_Item" class="XFormView">
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									编号：</div>
								<div class="ItemValue">
									<asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									用户名：</div>
								<div class="ItemValue">
									<asp:Label ID="UserNameLabel" runat="server" Text='<%# Bind("UserName") %>' />
								</div>
							</div>
							<div class="Item">
								<div class="ItemName">
									密码：</div>
								<div class="ItemValue">
									<asp:Label ID="PassWordLabel" runat="server" Text='<%# Bind("PassWord") %>' />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									登录：</div>
								<div class="ItemValue">
									<asp:Label ID="LoginsLabel" runat="server" Text='<%# Bind("Logins") %>' />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									地址：</div>
								<div class="ItemValue">
									<asp:Label ID="LastLoginIPLabel" runat="server" 
										Text='<%# Bind("LastLoginIP") %>' />
								</div>
							</div>
						</div>
						<div class="Row">
							<div class="Item">
								<div class="ItemName">
									时间：</div>
								<div class="ItemValue">
									<asp:Label ID="LastLoginTimeLabel" runat="server" 
										Text='<%# Bind("LastLoginTime", "{0:yyyy-MM-dd HH:mm:ss}") %>' />
								</div>
							</div>
						</div>
						<div class="Foot">
							<div style="float: left">
								<asp:LinkButton ID="EditButton" runat="server" CausesValidation="false" 
									CommandName="Edit" Text="编辑" />
							</div>
							<div style="width:5px; float:left">
							</div>
							<div style="float: left">
								<asp:LinkButton ID="NewButton" runat="server" CausesValidation="false" 
									CommandName="New" Text="新建" />
							</div>
							<div style="width:5px; float:left">
							</div>
							<div style="float: left">
								<asp:LinkButton ID="CancelSelectButton" runat="server" CausesValidation="false" 
									CommandName="CancelSelect" Text="取消" />
							</div>
						</div>
					</div>
				</itemtemplate>
                <EmptyDataTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="New">新增用户</asp:LinkButton>
                </EmptyDataTemplate>
            </XCL:XFormView>
            <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" DataObjectTypeName="XCMSData.User"
                InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="FindByKey"
                TypeName="XCMSData.User" UpdateMethod="Update">
                <SelectParameters>
                    <asp:ControlParameter ControlID="XGridView1" Name="__ID" PropertyName="SelectedValue"
                        Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </div>
    </form>
</body>
</html>
